Skip to main content

All Questions

-2votes
1answer
362views

How to replace a parameter's value in json file with a value taken from a different text file

I have a a large number of JSON files on a Linux machine, where I need to change the value of a parameter with value taken from a different text file. E.g.: If the JSON file has values like: { "...
vishal's user avatar
2votes
3answers
2kviews

Table records to convert into JSON file in unix with jq

I have table on a Linux machine which has a number of records; I am running a query to get: select * from TABNAME_XYZ CID CN XY NAT UIC DATE Region 12 2123 120.9 29.0 100.0 ...
user439643's user avatar
3votes
1answer
4kviews

How to get stamp in shell script in JSON file using jq tool?

I have question regarding shell scripting and jq tool to create a json file with timestamps. echo "{\"vtg\":[$value]}" | jq -a '. + {date: now|strflocaltime("%r")}' > ...
Sneha's user avatar
1vote
6answers
1kviews

How to parse a particular ids from a text file?

I have a lengthy text file, partial file content is shown below, [{"site":"1a2v_1","pfam":"Cu_amine_oxid","uniprot":"P12807"},{"site&...
Kumar's user avatar
7votes
4answers
32kviews

How to edit a JSON file using shell?

I am building a shell script that uses a JSON file. { "property1": true, "list": [ { "id": 1, "name": "APP1" }, { &...
hackedXD's user avatar
3votes
3answers
643views

How to parse Stdout as a mix of CSV and JSON?

I'm currently working on a class that has us submit our code to an auto-grader and then returns our results. The format it returns is kind of hard to visually parse, so I would like to write a script ...
dylanjm's user avatar
9votes
7answers
4kviews

Parse colon-separated value pairs (nmcli output) and convert to JSON fromat

I've written a script that converts the output of nmcli --mode multiline dev wifi into JSON, but I'm finding it's inconsistent (breaks when results have a space), long, and hard to read. I wonder if ...
Philip Kirkbride's user avatar
3votes
2answers
2kviews

Convert json numbers to strings in the shell

When parsing json, the command-line tool jshon converts numbers to scientific notation, and sometimes tries to round them. To avoid these problems, I want jshon to consider these numbers as strings. ...
admirabilis's user avatar

close